SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 402 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

How we
choose to interpret these results is up to us. We explained how to use the JSimpleXML
parser earlier in the chapter. We can use it to interpret the Yahoo! results:
$parser =& JFactory::getXMLParser('Simple');
$parser->loadString($xml);
$results =& $parser->document->Result;
Now that we have a parsed XML document, we can process the search results.
The $results variable becomes an array of result nodes; these are the nodes that
Yahoo! uses to encapsulate each result.
We will keep the processing simple, and output the results directly to screen as an
ordered list. This example uses the result sub-nodes ClickUrl, Title, Summary,
and DisplayUrl. In each case, we always access the zero element; we can do this
because we know that only one node of each of these types will ever be present in a
result node:
echo '
    ';
    for ($i = 0, $c = count($results); $i < $c; $i ++)
    {
    $result =& $results[$i];
    echo '
  1. ';
    echo 'target="_blank">'.$result->Title[0]-
    >data().


    Pages:
    390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6